﻿/*
 * Author:  hammercui
 * CreateTime: 2018/9/30 16:20:05
 * Module: interface
 * 主要功能：
 *
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MGAudioEngine
{

    public interface IMGAudioEngine
    {

        /// <summary>
        /// 授权app完成初始化
        /// </summary>
        /// <param name="appId"></param>
        /// <param name="appKey"></param>
        /// <param name="deviceToken"></param>
        void AuthApp(string appId,string appKey,string deviceToken);


        /// <summary>
        /// 初始化音频参数设置
        /// </summary>
        void InitAduioSetting();

        /// <summary>
        /// 更新音频参数设置
        /// </summary>
        void UpdateAudioSetting();


        /// <summary>
        /// 加入语音房间
        /// </summary>
        /// <param name="roomId"></param>
        /// <param name="userName"></param>
        void JoinRoom(long roomId,string userName);

        /// <summary>
        /// 退出房间
        /// </summary>
        /// <param name="roomId"></param>
        void QuitRoom(long roomId);

        /// <summary>
        /// 创建房间
        /// </summary>
        /// <param name="userName"></param>
        void CreateRoom(string userName);

        /// <summary>
        /// 加入频道
        /// </summary>
        /// <param name="channelId"></param>
        void JoinChannel(int channelId);

        /// <summary>
        /// 重新加入指定的房间
        /// </summary>
        /// <param name="roomId">房间id</param>
        void ReJoinRoom(long roomId);

        /// <summary>
        /// 发送文本信息
        /// </summary>
        /// <param name="msg">发送内容</param>
        /// <param name="channelId">频道id 默认0</param>
        /// <param name="isTree">是否广播</param>
        void SendTextMessage(String msg, int channelId, bool isTree);

        /// <summary>
        /// 打开麦克风
        /// </summary>
        int OpenMic();

        /// <summary>
        /// 关闭麦克风
        /// </summary>
        int CloseMic();

        /// <summary>
        /// 打开扬声器
        /// </summary>
        int OpenSpeaker();

        /// <summary>
        /// 关闭扬声器
        /// </summary>
        int CloseSpeaker();

        /// <summary>
        /// 销毁
        /// </summary>
        void DeallocMGAudio();

        /// <summary>
        /// 刷新连接状态
        /// </summary>
        /// <returns></returns>
        int GetIsConnect();

        /// <summary>
        /// 轮询获得消息
        /// </summary>
        /// <returns></returns>
        string GetMessage();


        //string GetSpeakState();

        //string GetSpeakInfo();

        //string GetUserJoinedChannel();

        //string GetChatMessage();
    }
}